#include <bits/stdc++.h>

using namespace std;

const int maxn=2500;
const int INF=1e9;
int n,m,g[maxn][maxn],pre[maxn],x,y;

int bfs(int s,int t){
    int flow[maxn];
    memset(pre,-1,sizeof(pre));
    flow[s]=INF;pre[s]=0;
    queue<int>Q;
    Q.push(s);
    while(!Q.empty()){
        int u=Q.front();
        Q.pop();
        if(u==t) break;
        for(int i=1;i<=n*n*2+1;i++){
            if(i!=s&&g[u][i]>0&&pre[i]==-1){
                pre[i]=u;
                Q.push(i);
                flow[i]=min(flow[u],g[u][i]);
            }
        }
    }
    if(pre[t]==-1) return -1;
    return flow[t];
}

int maxflow(int s,int t){
    int ans=0;
    while(1){
        int flow=bfs(s,t);
        if(flow==-1) break;
        int cur=t;
        while(cur!=s){
            int fa=pre[cur];
            g[fa][cur]-=flow;
            g[cur][fa]+=flow;
            cur=fa;
        }
        ans+=flow;
    }
    return ans;
}

int main()
{
    return 0;
}
